<template>
  <div class="index">
    <tree :treeData="treeData" @getNewTree="getNewTree"></tree>
  </div>
</template>

<script>
import tree from '@/components/tree'
export default {
  components: {
    tree
  },
  data () {
    return {
      treeData: [
        {
          id: 1,
          pid: 0,
          title: '文件夹1',
          key: 'asgsadga12112',
          files: ['411595325075_.png','抽奖1–扫明码.png','411595325075_.png','30091da4fc6e4eedb0a78847e9f4cce2.png'],
          children: [
            {
              pid: 1,
              title: '文件夹11',
              key: 'dsfhgjj4565',
              children: [],
              files: ['图片11','图片12'],
            },
          ],
        },
        {
          id: 2,
          pid: 0,
          title: '文件夹2',
          key: 'ghjkhgjlk33',
          files: ['411595325075_.png','抽奖1–扫明码.png','411595325075_.png','30091da4fc6e4eedb0a78847e9f4cce2.png'],
          children: [
            {
              pid: 2,
              title: '文件夹21',
              key: 'kjhklkkhjl99',
              children: [],
              files: ['图片21','图片22'],
            },
          ],
        },
        {
          id: 3,
          pid: 0,
          title: '文件夹3',
          key: 'hjlkhgfgghfg99',
          files: ['411595325075_.png','抽奖1–扫明码.png','411595325075_.png','30091da4fc6e4eedb0a78847e9f4cce2.png'],
          children: [
            {
              pid: 3,
              title: '文件夹31',
              key: 'hjhjfj465456',
              files: ['图片31','图片32'],
              children: [],
            },
          ],
        },
      ]
    }
  },
  methods: {
    getNewTree(value){
      this.treeData = value
    }
  }
}
</script>

<style scoped>
.index {
  padding: 20px;
  box-sizing: border-box;
}
</style>
